﻿<%@ Page Title="Users" Language="C#" MasterPageFile="~/System/System.master" AutoEventWireup="true" CodeFile="Users.aspx.cs" Inherits="System_Pages_Security_Users" %>
<%@ Register Src="~/System/Controls/FieldTemplates/MessageText.ascx" TagName="MessageText" TagPrefix="ucc" %>
<%@ Register Src="~/System/Controls/FieldTemplates/Boolean.ascx" TagName="Boolean" TagPrefix="ucc" %>
<%@ Register Src="~/System/Controls/FieldTemplates/FilteredText.ascx" TagName="FilteredText" TagPrefix="ucc" %>
<%@ Register Src="~/System/Controls/FieldTemplates/PasswordText.ascx" TagName="PasswordText" TagPrefix="ucc" %>
<%@ Register Src="~/System/Controls/FieldTemplates/SinglelineText.ascx" TagName="SinglelineText" TagPrefix="ucc" %>
<%@ Register Src="~/System/Controls/FieldTemplates/EmailAddress.ascx" TagName="EmailAddress" TagPrefix="ucc" %>
<%@ Register Src="~/System/Controls/FieldTemplates/MultilineText.ascx" TagName="MultilineText" TagPrefix="ucc" %>
<%@ Register Src="~/System/Controls/FieldTemplates/ReadOnlyText.ascx" TagName="ReadOnlyText" TagPrefix="ucc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="SiteFox_Left" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="SiteFox_Title" Runat="Server">
    <asp:Image ID="img_Title" runat="server" ImageUrl="~/System/Design/ico/32x32/user1.png" ToolTip="<%$ Resources:dcCommon, dc_Users %>" />
    <asp:Label ID="lab_Title" runat="server" Text="<%$ Resources:dcCommon, dc_Users %>" />
    <asp:UpdatePanel ID="up_Title" runat="server">
        <ContentTemplate>
            <asp:ImageButton ID="imb_Add" runat="server" ImageUrl="~/System/Design/ico/24x24/user1_new.png" CssClass="ActionImgButton" ToolTip="<%$ Resources:dcCommon, dc_New %>" onclick="imb_Add_Click" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="SiteFox_Main" Runat="Server">
    <asp:UpdatePanel ID="up_Main" runat="server">
        <ContentTemplate>
            <asp:GridView runat="server" ID="gv_Users" AutoGenerateColumns="false" RowStyle-CssClass="GridViewRow" Width="100%" GridLines="None">
                <Columns>
                    <asp:BoundField DataField="Username" HeaderText="Username" />
                    <asp:BoundField DataField="Email" HeaderText="Email" Visible="false" />
                    <asp:BoundField DataField="Created" HeaderText="<%$ Resources:dcCommon, dc_CreationDate %>" ItemStyle-HorizontalAlign="Center" />
                    <asp:CheckBoxField DataField="Approved" HeaderText="<%$ Resources:dcCommon, dc_IsActive %>" />
                    <asp:CheckBoxField DataField="Locked" HeaderText="<%$ Resources:dcCommon, dc_IsLockedOut %>" />
                    <asp:TemplateField ItemStyle-HorizontalAlign="Right">
                        <ItemTemplate>
                            <asp:ImageButton ID="imb_User_Edit" runat="server" ImageUrl="~/System/Design/ico/16x16/edit.png" OnClick="imb_Edit_Click" CommandArgument='<%# Eval("UserName") %>' />
                            <asp:ImageButton ID="imb_User_Delete" runat="server" ImageUrl="~/System/Design/ico/16x16/delete2.png" OnClick="imb_Delete_Click" CommandArgument='<%# Eval("UserName") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>


            <asp:Panel ID="pan_AddOrEdit" runat="server" Visible="false">
                <div class="ActionPanel_Background"></div>
                <div class="ActionPanel" style="height: 500px;">
                    <div class="ActionPanel_Header">
                        <asp:Label ID="lab_AddOrEdit_Title" runat="server" />
                        <asp:ImageButton ID="imb_AddOrEdit_Close" runat="server" CssClass="ActionPanel_Close" ImageUrl="~/System/Design/ico/24x24/delete.png" onclick="imb_AddOrEdit_Close_Click" />
                    </div>
                    <div class="ActionPanel_Content">
                        <ucc:Boolean ID="ucc_IsApproved" runat="server" Title="<%$ Resources:dcCommon, dc_ActiveUser %>" />
                        <ucc:FilteredText ID="ucc_Username" runat="server" Title="<%$ Resources:dcCommon, dc_Username %>" IsReq="true" ValueMaxLength="20" FilterType="LowercaseLetters" />
                        <asp:Panel ID="pan_Password_Row" runat="server" CssClass="FieldTemplates_Row">
                            <asp:Label ID="lab_Password_Title" runat="server" CssClass="Label" Text="<%$ Resources:dcCommon, dc_Password %>" />
                            <asp:TextBox ID="tb_Password_Value" runat="server" CssClass="TextBox" TextMode="Password" MaxLength="20" />
                            <asp:RequiredFieldValidator ID="rfv_Password" runat="server" ErrorMessage="*" 
                                Text="*" ValidationGroup="mainValGroup" ControlToValidate="tb_Password_Value" CssClass="RequiredFieldValidator" />
                        </asp:Panel>
                        <asp:Panel ID="pan_Password2_Row" runat="server" CssClass="FieldTemplates_Row">
                            <asp:Label ID="lab_Password2_Title" runat="server" CssClass="Label" Text="<%$ Resources:dcCommon, dc_PasswordConfirm %>" />
                            <asp:TextBox ID="tb_Password2_Value" runat="server" CssClass="TextBox" TextMode="Password" MaxLength="20" />
                            <asp:RequiredFieldValidator ID="rfv_Password2" runat="server" ErrorMessage="*" 
                                Text="*" ValidationGroup="mainValGroup" ControlToValidate="tb_Password2_Value" CssClass="RequiredFieldValidator" />
                            <asp:CompareValidator ID="cv_Password" runat="server" ErrorMessage="*" Text="<%$ Resources:dcCommon, dc_PasswordsAreNotSame %>" 
                                ControlToCompare="tb_Password2_Value" ControlToValidate="tb_Password_Value" Display="Dynamic" />
                        </asp:Panel>
                        <ucc:SinglelineText ID="ucc_PasswordQuestion" runat="server" Title="<%$ Resources:dcCommon, dc_PasswordQuestion %>" IsReq="true" ValueMaxLength="50" />
                        <ucc:SinglelineText ID="ucc_PasswordAnswer" runat="server" Title="<%$ Resources:dcCommon, dc_PasswordAnswer %>" IsReq="true" ValueMaxLength="50" />
                        <ucc:EmailAddress ID="ucc_Email" runat="server" IsReq="true" Title="<%$ Resources:dcCommon, dc_Email %>" />
                        <ucc:MultilineText ID="ucc_Comment" runat="server" Title="<%$ Resources:dcCommon, dc_Comment %>" IsReq="false" ValueRows="3" />

                        <ucc:Boolean ID="ucc_IsLockedOut" runat="server" Title="<%$ Resources:dcCommon, dc_IsLockedOut %>" ValueEnabled="false" Visible="false" />
                        <ucc:Boolean ID="ucc_IsOnLine" runat="server" Title="<%$ Resources:dcCommon, dc_IsOnLine %>" ValueEnabled="false" Visible="false" />
                        <ucc:ReadOnlyText ID="ucc_CreationDate" runat="server" Title="<%$ Resources:dcCommon, dc_CreationDate %>" Visible="false" />
                        <ucc:ReadOnlyText ID="ucc_LastActivityDate" runat="server" Title="<%$ Resources:dcCommon, dc_LastActivityDate %>" Visible="false" />
                        <ucc:ReadOnlyText ID="ucc_LastLoginDate" runat="server" Title="<%$ Resources:dcCommon, dc_LastLoginDate %>" Visible="false" />
                        <ucc:ReadOnlyText ID="ucc_LastLockoutDate" runat="server" Title="<%$ Resources:dcCommon, dc_LastLockoutDate %>" Visible="false" />
                        <ucc:ReadOnlyText ID="ucc_LastPasswordChangedDate" runat="server" Title="<%$ Resources:dcCommon, dc_LastPasswordChangedDate %>" Visible="false" />

                        <div class="FieldTemplates_Row">
                            <span class="Label"><%= Resources.dcCommon.dc_Roles %></span>
                            <asp:CheckBoxList ID="UserRoles" runat="server" RepeatDirection="Horizontal" RepeatColumns="5" />
                        </div>

                        <ucc:MessageText ID="ucc_AddOrEdit_Message" runat="server" />
                        <asp:LinkButton ID="lib_AddOrEdit_Ok" runat="server" CssClass="LinkButton" ValidationGroup="mainValGroup" onclick="lib_AddOrEdit_Ok_Click" />
                    </div>
                </div>
            </asp:Panel>
            <asp:HiddenField ID="hf_Username" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

